home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1986 January & February
/
rerun-1986-01-02.d64
/
autoboot 128
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
3KB
|
101 lines
10 rem c128 autoboot disk maker
15 mo=0:print"[147]":ifpeek(215)<>0then mo=5:goto500
20 (NULL)1,1:(NULL)0,6:(NULL)4,6
30 (NULL)1,1
40 (NULL)"auto.pic" to "auto.pic"
50 e$=left$(ds$,2)
60 ife$<>"63"thengosub620:(NULL) (NULL)"auto.col",d0:(NULL)"auto.pic",d0
70 clr:goto500
80 rem insert disk
90 s1$=" insert disk to autoboot"
100 s2$="press spacebar when ready.":gosub820
110 (NULL):get(NULL) a$:(NULL) (NULL) a$=" ":gosub850
120 return
130 rem check track 1 sector 0 for data already there
140 open1,8,15:open2,8,2,"#":gosub480
150 print#1,"u1:";2;0;1;0
160 get#2,a$:get#2,b$:ifasc(a$+chr$(0))<>0orasc(b$+chr$(0))<>0then gosub190
170 close2:close1:return
180 rem rewrite auto boot (y/n)
190 s1$="already an autoboot disk!"
200 s2$="should i continue? (y/n)":gosub820
210 get(NULL) a$
220 ifa$="y"then gf=1:gosub850:return
230 ifa$="n"then gosub 850:(NULL)1,7,6," program stopped",1:close2:close1:(NULL)5:(NULL) mo,1:(NULL)5,14:end:(NULL) goto210
240 rem write track 1, sector 0.
250 s1$=" enter bootup message":s2$="":gosub820
260 dn$="":gosub890:dn$=w$
270 gosub850:s1$="are you booting a basic or"
280 s2$=" ml program (b/m) ":gosub820
290 get(NULL) a$
300 if a$="b" or a$="[194]" then ml=0:gosub850:goto 320
310 if a$="m" or a$="[205]" then ml=1:gosub850:(NULL) goto290
320 gosub850:s1$=" program to auto boot?":s2$="":gosub820
330 nm$="":gosub890:nm$=w$:iflen(nm$)=0then330
340 gosub850:(NULL)1,7,6,"writing auto boot...",1
350 ml$="cbm"+chr$(0)+chr$(0)+chr$(0)+chr$(0)+dn$+chr$(0)+chr$(0)+chr$(162)
360 ad=2816+len(dn$)+15
370 ml$=ml$+chr$(adand255)+chr$(160)+chr$(ad/256)+chr$(76)+chr$(165)
380 ml$=ml$+chr$(175)
390 if ml=0 then ml$=ml$+"run"
400 if ml=1 then ml$=ml$+"boot"
410 ml$=ml$+chr$(34)+nm$+chr$(0)
420 open1,8,15:open2,8,2,"#":gosub480
430 print#1,"b-p:";2;0
440 print#2,ml$;
450 print#1,"u2:";2;0;1;0:gosub480
460 close2:close1:return
470 rem read error channel
480 ifds>1then(NULL) mo,1:printds$:close2:close1:end
490 return
500 rem main body
510 gf=0
520 (NULL)1,7:s1$=" c128 auto boot maker"
530 s2$=" by d darus & l wallace":gosub820:(NULL)5
540 gosub80:rem insert disk
550 gosub140:rem check track 1 sector 0 for data already there.
560 gosub250:rem write track 1, sector 0.
570 ifgf=1then610
580 open1,8,15:fort=0to20:print#1,"b-a:" 0;1;t:next
590 ifds=65thengosub190:goto610
600 ifds>0thenprintds$
610 close1:s1$="all done!":s2$="press any key to end":gosub850:gosub820:get(NULL) a$:(NULL) mo,1:(NULL)5,14:end
620 (NULL)%:(NULL)1,1:(NULL)1,3
630 (NULL)1,13,2,"autodisk maker"
640 (NULL)1,1
650 (NULL)1,40,32,280,186
660 (NULL)1,160,105,32,25
670 (NULL)1,160,150,8,5,270,90
680 (NULL)1,152,150 to 152,170
690 (NULL)1,168,150 to 168,170
700 (NULL)1,160,170,8,5,90,270
710 (NULL)1,195,125,5,4
720 (NULL)1,276,63,280,70
730 (NULL)0,280,64 to 280,69
740 (NULL)1,7
750 (NULL)1,56,40,264,71,,1
760 (NULL)1,1
770 (NULL)1,45,40
780 (NULL)&
790 (NULL)"auto.pic",b0,d0,p8192 to p16191
800 (NULL)"auto.col",b0,d0,p7168 to p8191
810 return
820 (NULL)1,7,5,s1$,1
830 (NULL)1,7,7,s2$,1
840 return
850 (NULL)1,7:(NULL)1,7,5," ",1: rem 27 spaces
860 (NULL)1,7,6," ",1: rem 27 spaces
870 (NULL)1,7,7," ",1: rem 27 spaces
880 return
890 ct=0:xp=7:tx$="":w$=""
900 get(NULL) tx$
910 a=asc(tx$)
920 ifa=13thenreturn
930 ifa=20andlen(w$)>0thenw$=left$(w$,len(w$)-1):tx$=" ":goto980
940 ifa=20then900
950 ifa$=chr$(34)then900
960 iflen(w$) >=16 then900
970 xp=xp+1:w$=w$+tx$
980 (NULL)1,xp,7,tx$,1:ifa=20thenxp=xp-1
990 goto900